static void
client_data_free (ClientData *data)
{
- g_signal_handler_disconnect (data->client, data->backend_died_id);
+ g_clear_signal_handler (&data->backend_died_id, data->client);
g_object_unref (data->client);
g_slice_free (ClientData, data);
}
if (sources->priv->registry)
{
- g_signal_handler_disconnect (sources->priv->registry,
- sources->priv->source_added_id);
- g_signal_handler_disconnect (sources->priv->registry,
- sources->priv->source_changed_id);
- g_signal_handler_disconnect (sources->priv->registry,
- sources->priv->source_removed_id);
+ g_clear_signal_handler (&sources->priv->source_added_id,
+ sources->priv->registry);
+ g_clear_signal_handler (&sources->priv->source_changed_id,
+ sources->priv->registry);
+ g_clear_signal_handler (&sources->priv->source_removed_id,
+ sources->priv->registry);
g_object_unref (sources->priv->registry);
}
sources->priv->registry = NULL;
g_hash_table_unref (app->appointments);
g_object_unref (app->connection);
- g_signal_handler_disconnect (app->sources,
- app->sources_signal_id);
+ g_clear_signal_handler (&app->sources_signal_id, app->sources);
g_object_unref (app->sources);
if (app->changed_timeout_id != 0)
/* 'for loop' or 'four loop'? */
for (i = 0; i < 4; i++)
- g_signal_handler_disconnect (group->group, group->handler_ids[i]);
+ g_clear_signal_handler (&group->handler_ids[i], group->group);
g_object_unref (group->group);
g_free (group->prefix);
guint refcount;
/* Signal connection to dirty window sort list on workspace changes */
- guint workspace_switch_id;
+ gulong workspace_switch_id;
GSList *windows;
if (state->refcount > 0)
return;
- g_signal_handler_disconnect (workspace_manager, state->workspace_switch_id);
+ g_clear_signal_handler (&state->workspace_switch_id, workspace_manager);
g_clear_object (&state->application_proxy);
ShellEmbeddedWindow *window;
ClutterActor *window_actor;
- guint window_actor_destroyed_handler;
+ gulong window_actor_destroyed_handler;
- guint window_created_handler;
+ gulong window_created_handler;
};
G_DEFINE_TYPE_WITH_PRIVATE (ShellGtkEmbed, shell_gtk_embed, CLUTTER_TYPE_CLONE);
if (priv->window_actor)
{
- g_signal_handler_disconnect (priv->window_actor,
- priv->window_actor_destroyed_handler);
- priv->window_actor_destroyed_handler = 0;
+ g_clear_signal_handler (&priv->window_actor_destroyed_handler,
+ priv->window_actor);
g_object_unref (priv->window_actor);
priv->window_actor = NULL;
/* Now that we've found the window we don't need to listen for
new windows anymore */
- g_signal_handler_disconnect (display,
- priv->window_created_handler);
- priv->window_created_handler = 0;
+ g_clear_signal_handler (&priv->window_created_handler,
+ display);
}
}
if (priv->window)
{
- if (priv->window_created_handler)
- {
- g_signal_handler_disconnect (display,
- priv->window_created_handler);
- priv->window_created_handler = 0;
- }
+ g_clear_signal_handler (&priv->window_created_handler, display);
shell_gtk_embed_remove_window_actor (embed);
clos = data;
timeline = CLUTTER_TIMELINE (clos->transition);
- g_signal_handler_disconnect (clos->transition, clos->completed_id);
+ g_clear_signal_handler (&clos->completed_id, clos->transition);
if (clutter_timeline_is_playing (timeline))
clutter_timeline_stop (timeline);
{
ClutterActor *icon_texture;
ClutterActor *pending_texture;
- guint opacity_handler_id;
+ gulong opacity_handler_id;
GIcon *gicon;
gint prop_icon_size; /* icon size set as property */
StIcon *icon = user_data;
StIconPrivate *priv = icon->priv;
- g_signal_handler_disconnect (priv->pending_texture, priv->opacity_handler_id);
- priv->opacity_handler_id = 0;
+ g_clear_signal_handler (&priv->opacity_handler_id, priv->pending_texture);
st_icon_finish_update (icon);
}
ClutterActor *actor;
gint size;
GObject *source;
- guint notify_signal_id;
+ gulong notify_signal_id;
gboolean weakref_active;
} StTextureCachePropertyBind;
{
StTextureCachePropertyBind *bind = data;
bind->weakref_active = FALSE;
- g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
+ g_clear_signal_handler (&bind->notify_signal_id, bind->source);
}
static void
ClutterTimeline *timeline;
- guint timeline_completed_id;
- guint timeline_new_frame_id;
+ gulong timeline_completed_id;
+ gulong timeline_new_frame_id;
ClutterActorBox last_allocation;
ClutterActorBox offscreen_box;
if (priv->timeline)
{
- if (priv->timeline_completed_id != 0)
- g_signal_handler_disconnect (priv->timeline,
- priv->timeline_completed_id);
- if (priv->timeline_new_frame_id != 0)
- g_signal_handler_disconnect (priv->timeline,
- priv->timeline_new_frame_id);
+ g_clear_signal_handler (&priv->timeline_completed_id, priv->timeline);
+ g_clear_signal_handler (&priv->timeline_new_frame_id, priv->timeline);
g_clear_object (&priv->timeline);
}
g_clear_pointer (&priv->label_actor, g_object_unref);
- if (priv->texture_file_changed_id != 0)
- {
- g_signal_handler_disconnect (st_texture_cache_get_default (), priv->texture_file_changed_id);
- priv->texture_file_changed_id = 0;
- }
+ g_clear_signal_handler (&priv->texture_file_changed_id,
+ st_texture_cache_get_default ());
g_clear_object (&priv->first_visible_child);
g_clear_object (&priv->last_visible_child);